@extends('layouts.backend')
@section('title')
    评论列表
@endsection

@section('body')
    <div class="row">
        <div class="ibox">
            <div class="ibox-title">
                <h5>评论列表</h5>
            </div>
            <div class="ibox-content">
                <div class="row">

                    <div class="col-md-6">
                        <form role="form" class="form-inline" method="get">
                            <div class="form-group">
                                <input type="text" placeholder="Enter Keyword " value="{{request('keyword', '')}}" name="keyword" id="keyword" class="form-control">

                            </div>
                            <button class="btn btn-primary" type="submit">搜索</button>
                            <a href="{{ route('backend.comment.index') }}" class="btn btn-warning">重置</a>
                        </form>
                    </div>

                </div>
                <table class="table">
                    <thead>
                    <tr>
                        <th>#</th>
                        <th>标题</th>
                        <th>评论人</th>
                        <th>内容</th>
                        <th>创建时间</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    @forelse($comments as $comment)
                        <tr>
                            <td>{{$comment->id}}</td>
                            <td>{{$comment->article_title}}</td>
                            <td>
                                {{$comment->user_name}}
                            </td>
                            <td>{{$comment->content}}</td>
                            <td>{{$comment->created_at}}</td>
                            <td>
                                @include('components.backend.destroy', ['url' => route('backend.comment.destroy', $comment)])
                            </td>
                        </tr>
                    @empty
                        <tr>
                            <td class="text-center" colspan="7">暂无记录</td>
                        </tr>
                    @endforelse
                    </tbody>
                </table>
            </div>
            <div class="ibox-footer">
                {{$comments->render()}}
            </div>
        </div>
    </div>
@endsection
